{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% block title %}
添加文章
{% endblock %}

{% block header %}添加文章{% endblock %}
{% block content %}
<form action="." method="POST">
    {% csrf_token %}
    {{ form|crispy }}
    <button type="submit" class="btn btn-success mt-2 btn-block btn-lg">添加</button>
</form>



<!-- <form action="." method="POST">
        {% csrf_token %}

        文章ID：&nbsp;&nbsp;&nbsp;<input type="text" name="article_id" class="border">&nbsp;
        文章标题：&nbsp;&nbsp;&nbsp;<input type="text" name="title" class="border" id="a"><br><br>
        文章类型：<select name="kind" id="">
            {% for i in kinds %}    
                <option value="{{ i.id }}">{{ i }}</option>
            {% endfor %}
        </select><br><br>
        文章内容：<textarea cols="40" rows="10" name="content" class="border"></textarea><br><br>
        <input type="submit" value="添加" class="btn btn-secondary">
    </form>
    <script>
        var id = document.querySelector('.border');
        var title = document.querySelector('#a');
        var text = document.querySelector('textarea');
        if(id.value==='' | title.value==='' | text.innerHTML===''){
            alert('请填写完整的文章信息！');
        }
    </script> -->
{% endblock %}